#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <map>
#include <cmath>
using namespace std;
int GetGCD(int a,int b)
{
	if (a % b ==0)
	{
		return b;
	}
	if (b % a ==0)
	{
		return a;
	}

	if (a > b)
	{
		return GetGCD(a%b,b);
	}
	return GetGCD(a,b%a);
}
int main3979()
{
	string str;
	while(cin >> str)
	{
		int a,b,c,d;
		char op;
		a = str[0] - '0';
		b = str[2] - '0';
		op = str[3];
		c = str[4] - '0';
		d = str[6] - '0';
	
		
		int fenzi = 0;
		
		bool isNeg = false;
		if (op == '+')
		{
			fenzi = a * d + b * c;
		}else{
			fenzi = a* d - b * c;
			if (fenzi <0)
			{
				isNeg = true;
				fenzi = -fenzi;
			}
		}
		int fenmu = b * d;
		
		if (fenzi == 0)
		{
			cout << 0 << endl;
			continue;
		}
		int gcd = GetGCD(fenzi,fenmu);

		if (isNeg)
		{
			cout << "-";
		}
			
		if (fenmu / gcd == 1)
		{
			cout << fenzi / gcd << endl;
		}else{
			cout << fenzi / gcd << "/" << fenmu / gcd << endl;
		}

	}
	return 0;
}